<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
</head>
<body>
<div class="container-fluid">
    <div class="panel panel-info">
        <div class="panel-heading">
            <h4>查询条件</h4>
            <a class="caret pull-right" data-toggle="collapse" href="#content"></a>
        </div>
        <div id="content" class="panel-collapse collapse in">
            <div class="panel-body">
                <form id="condition"  class="form-inline">
                    <div class="row">
                        <div class="panel-group col-md-4">
                            <label for="loginName">区域名称:</label>
                            <input type="text" id="loginName" name="areaName" class="form-control" placeholder="区域名称"/>

                        </div>
                        <div class="panel-group col-md-4">
                            <label for="userName">区域编码:</label>
                            <input type="text" id="userName" name="areaCode" class="form-control" placeholder="区域编码"/>
                        </div>
                        <div class="panel-group col-md-4">
                            <label for="role">所属院区:</label>
                            <select class="form-control" id="role" name="branchCode">
                                <option value="">请选择</option>
                                <c:forEach items="${branchs}" var="d">
                                    <option value="${d.branchCode}">${d.branchName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="panel-group col-md-4">
                            <label for="warehouseClass">仓库级别:</label>
                            <select class="form-control" id="warehouseClass" name="warehouseClass" onchange="sss()">
                                <option value="1">一级库</option>
                                <option value="2">二级库</option>
                            </select>
                        </div>
                        <div class="panel-group col-md-4">
                            <label for="branch">所属仓库:</label>
                            <select class="form-control" id="branch" name="warehouseCode">
                                <option value="">请选择</option>
                                <option value="1001">五金库</option>
                                <option value="1002">卫材库</option>
                            </select>
                        </div>
                        <div class="panel-group col-md-4">
                            <label for="department">所属科室:</label>

                            <select  class="form-control" id="department" name="departmentCode" disabled="disabled">
                                <option value="">请选择</option>
                                <c:forEach items="${departments}" var="d">
                                    <option value="${d.departmentCode}">${d.departmentName}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-10"></div>
                        <div class="col-md-2">
                            <button class="btn btn-primary" type="button" onclick="searchTjArea()">查询</button>
                            <button class="btn btn-primary" type="button" onclick="addArea()">新增</button>
                        </div>

                    </div>

                </form>
            </div>
        </div>
    </div>
    <table id="table" data-toggle="table"
           data-pagination="true"
           data-side-pagination="server"
           data-url="base/area/searchByAreaPager"
           data-toolbar-algin="right"
           data-align="center"
    >
        <thead>
        <tr>
            <th data-field="areaId">序号</th>
            <th data-field="areaCode">区域编号</th>
            <th data-field="warehouse.warehouseName">所属仓库</th>
            <th data-field="branch.branchName">所属院区</th>
            <th data-field="deleteFlag" data-formatter="FormatState">是否可用</th>
            <th data-field="areaDesc">描述</th>
            <th data-formatter="FormatOperation">操作</th>
        </tr>
        </thead>
    </table>
</div>

<div class="hidden" id="UpArea">
    <form id="updateArea"  class="form-horizontal">
        <div class="row">

            <div class="form-group col-md-4">
                <label for="">区域名称:</label>
                <input type="text"  name="areaName" class="form-control"/>
                <input type="text"  name="areaId" class="hidden"/>
            </div>
            <div class="form-group col-md-4">
                <label for="">区域编码:</label>
                <input type="text"  name="areaCode" class="form-control"  disabled="disabled"/>
            </div>
            <div class="form-group col-md-4">
                <label for="">所属院区:</label>
                <input type="text"  name="branchCode" class="form-control" disabled="disabled"/>
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-4">
                <label for="">仓库级别:</label>
                <input type="text" class="form-control" name="warehouseClass" disabled="disabled">
            </div>
            <div class="form-group col-md-4">
                <label for="">所属仓库:</label>
                <input type="text" class="form-control" name="warehouseCode" disabled="disabled">
            </div>
            <div class="form-group col-md-4">
                <label for="">所属科室:</label>
                <input type="text" class="form-control" name="departmentCode" disabled="disabled">
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-4">
                <label for="">是否可用:</label>
                <select class="form-control"  name="deleteFlag">
                    <option value="Y">是</option>
                    <option value="N">否</option>
                </select>
            </div>
            <div class="form-group col-md-4">
                <label for="">描述:</label>
                <input type="text" class="form-control" name="areaDesc">
            </div>
        </div>



    </form>
</div>

<div class="hidden" id="AddArea">
    <form id="adArea"  class="form-horizontal">
        <div class="row">

            <div class="form-group col-md-4">
                <label for="">区域名称:</label>
                <input type="text"  name="areaName" class="form-control"/>
            </div>
            <div class="form-group col-md-4">
                <label for="">区域编码:</label>
                <input type="text"  name="areaCode" class="form-control"/>
            </div>
            <div class="form-group col-md-4">
                <label for="">所属院区:</label>
                <select class="form-control" name="branchCode">
                    <c:forEach var="i" items="${branchs}">
                    <option value="${i.branchCode}">${i.branchName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-4">
                <label for="">仓库级别:</label>
                <select class="form-control" id="asdf" name="warehouseClass" onchange="addAreaJb()">
                    <option value="1">一级库</option>
                    <option value="2">二级库</option>
                </select>
            </div>
            <div class="form-group col-md-4">
                <label for="">所属仓库:</label>
                <select class="form-control"  name="warehouseCode">
                    <c:forEach var="ii" items="${warehouses}">
                    <option value="${ii.warehouseCode}">${ii.warehouseName}</option>
                    </c:forEach>
                </select>
            </div>
            <div class="form-group col-md-4">
                <label for="">所属科室:</label>
                <select  class="form-control" name="departmentCode" disabled="disabled">
                    <c:forEach items="${departments}" var="d">
                        <option value="${d.departmentCode}">${d.departmentName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-4">
                <label for="">是否可用:</label>
                <select class="form-control"  name="deleteFlag">
                    <option value="Y">是</option>
                    <option value="N">否</option>
                </select>
            </div>
            <div class="form-group col-md-4">
                <label for="">描述:</label>
                <input type="text" class="form-control" name="areaDesc">
            </div>
        </div>

    </form>
</div>
<%@include file="/WEB-INF/pages/common/modal.jsp"%>
<script src="res/js/area.js"></script>
</body>
</html>